package cn.swu.cs.lesson12

import android.os.Bundle
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.appcompat.app.AppCompatActivity

class WebviewActivity : AppCompatActivity() {

    lateinit var webview:WebView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_webview)

        webview = findViewById(R.id.webview)

        webview.settings.let {
            it.javaScriptEnabled = true
        }
//        webview.webChromeClient
        val client = WebViewClient()
        //val chrome = WebChromeClient()

//        client.
        webview.webViewClient = client

        webview.loadUrl("https://3g.163.com/")

    }

}